package com.hucheng.rest.controller;

import com.hucheng.common.exception.EduException;
import com.hucheng.common.result.ReturnVO;
import com.hucheng.user.api.feign.UserFeignClient;
import com.hucheng.user.api.query.UserQuery;
import com.hucheng.user.api.vo.UserVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: 凉白开不加冰
 * @Version: 0.0.1V
 * @Date: 2019-06-13
 * @Description: 用户Controller
 **/
@RestController
@RequestMapping("user")
public class UserCrtl {

    @Autowired
    private UserFeignClient userFeignClient;

    @PostMapping("findUserByName")
    public ReturnVO findUserByName(UserQuery userQuery) throws EduException {
        UserVO userVO = userFeignClient.findUserByName(userQuery);
        return new ReturnVO(userVO);
    }

}
